﻿
@{
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" name="viewport" content="text/html; charset=utf-8" />
    <title>用户注册</title>

    <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="/css/lr.css" />

    <script src="/js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
$(function() {
	
	$('#register').click(function() {
		var name_r_state = $('#name_r');
		var psd_r_state = $('#psd_r');
		var affirm_psd_state = $('#affirm_psd');
		var name_r = $('#name_r').val();
		var psd_r = $('#psd_r').val();
		var affirm_psd = $('#affirm_psd').val();
		var vcode = $("#vcode");
		var vcode_v = $("#vcode").val();
		if (vcode_v == '')
		{
		    vcode.parent().next().next().css("display", "block");
		    return false;
		}
		else if (name_r == '') {
			name_r_state.parent().next().next().css("display", "block");
			return false;
		} else if (psd_r == '') {
			psd_r_state.parent().next().next().css("display", "block");
			return false;
		} else if (affirm_psd == '') {
			affirm_psd_state.parent().next().next().css("display", "block");
			return false;
		} else if (psd_r != affirm_psd) {
			return false;
		} else {
			$('.register').submit();
		}
	})
})


function ok_or_errorByRegister(r) {
	var affirm_psd = $("#affirm_psd");
	var psd_r = $("#psd_r");
	var affirm_psd_v = $("#affirm_psd").val();
	var psd_r_v = $("#psd_r").val();
	var vcode = $("#vcode").val();
	var content = $(r).val();
	if (content == "") {
		$(r).parent().next().next().css("display", "block");
		return false;
	} else {
		$(r).parent().next().css("display", "block");
		$(r).parent().next().next().css("display", "none");
		if (vcode=="") {
		    return false;
		}
		if (psd_r_v == "") {
			$(psd_r).parent().next().css("display", "none");
			$(psd_r).parent().next().next().css("display", "none");
			$(psd_r).parent().next().next().css("display", "block");
			return false;
		}
		if (affirm_psd_v == "") {
			$(affirm_psd_v).parent().next().css("display", "none");
			$(affirm_psd_v).parent().next().next().css("display", "none");
			$(affirm_psd_v).parent().next().next().css("display", "block");
			return false;
		}
		if (psd_r_v == affirm_psd_v) {
			$(affirm_psd).parent().next().css("display", "none");
			$(affirm_psd).parent().next().next().css("display", "none");
			$(psd_r).parent().next().css("display", "none");
			$(psd_r).parent().next().next().css("display", "none");
			$(affirm_psd).parent().next().css("display", "block");
			$(psd_r).parent().next().css("display", "block");
		} else {
			$(affirm_psd).parent().next().css("display", "none");
			$(affirm_psd).parent().next().next().css("display", "none");
			$(psd_r).parent().next().css("display", "none");
			$(psd_r).parent().next().next().css("display", "none");
			$(psd_r).parent().next().css("display", "block");
			$(affirm_psd).parent().next().next().css("display", "block");
			return false;
		}

	}
}

function ResetVCode() {

	
	    $("#imgvcode").attr("src", "/M/VCode?m=" + Date());
	 
}
    </script>
</head>

<body class="login_body">



    <div class="register_body">
        <div class="col-xs-12 register_title">注册</div>
        <form action="" class="register" method="post">
            <div class="nav">
                <div class="nav register_nav">
                    <div class="col-xs-4">
                        用户名:
                    </div>
                    <div class="col-xs-6">
                        <input type="text" name="" id="name_r" value="" placeholder="&nbsp;&nbsp;用户名" onBlur="javascript:ok_or_errorByRegister(this)" />
                    </div>
                    <div class="col-xs-1 ok_gou">
                        √
                    </div>
                    <div class="col-xs-1 error_cuo">
                        ×
                    </div>
                </div>
                <div class="nav register_psdnav">
                    <div class="col-xs-4">
                        密&nbsp;&nbsp;&nbsp;码:
                    </div>
                    <div class="col-xs-6">
                        <input type="password" name="" id="psd_r" value="" placeholder="&nbsp;&nbsp;密码" onBlur="javascript:ok_or_errorByRegister(this)" />
                    </div>
                    <div class="col-xs-1 ok_gou">
                        √
                    </div>
                    <div class="col-xs-1 error_cuo">
                        ×
                    </div>
                </div>
                <div class="nav register_affirm">
                    <div class="col-xs-4">
                        确认密码:
                    </div>
                    <div class="col-xs-6">
                        <input type="password" name="" id="affirm_psd" value="" placeholder="&nbsp;&nbsp;确认密码" onBlur="javascript:ok_or_errorByRegister(this)" />
                    </div>
                    <div class="col-xs-1 ok_gou">
                        √
                    </div>
                    <div class="col-xs-1 error_cuo">
                        ×
                    </div>
                </div>
                <div class="nav register_affirm">
                    <div class="col-xs-4">
                        验证码:
                    </div>
                    <div class="col-xs-6">
                        <input type="text" name="vcode" id="vcode" value="" placeholder="&nbsp;&nbsp;验证码" onBlur="javascript:ok_or_errorByRegister(this)" />
                        <a href="#" onclick="ResetVCode()"> <img id="imgvcode" alt="换一张" src="/M/VCode" /></a>
                    </div>

                    <div class="col-xs-1 ok_gou">
                        √
                    </div>
                    <div class="col-xs-1 error_cuo">
                        ×
                    </div>
                </div>
                <div class="col-xs-12 register_btn_div">
                    <input type="submit" class="sub_btn" value="注册" id="register" />
                </div>
            </div>
        </form>
        <div class="col-xs-12 barter_register">
            <a class="barter_registerBtn" href="/M/Login" style="">已有帐号?返回登录</a>
        </div>
    </div>
 

</body>
</html>